
package cesdentalrecord.dao.view;


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import cesdentalrecord.dao.controller.AddInitialConditionController;
//import cesdentalrecord.test.AddInitialConditionController;
import cesdentalrecord.dao.Student;


public class AddInitialConditionView {
    
    
    AddInitialConditionController aicc = new AddInitialConditionController();
    
    
    public void displayAcknowledgement(){
    	System.out.println("Initial condition has been successfully added.");
    }

    public void sendAddInitialConditionRequest(int studentID,String dateOfExam, 
			boolean dentalCaries,boolean gingivitis,boolean debris,boolean calculus,boolean abnormalGrowth,
			boolean cleftLip,boolean other) throws IOException {
		// TODO Auto-generated method stub
		
		Student s = new Student();

		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		AddInitialConditionView aicv = new AddInitialConditionView();
		
		SearchView search = new SearchView();
		
		
	   /* int studentID;
	    String dateOfExam;
	    boolean dentalCaries;
	    boolean gingivitis;
	    boolean debris;
	    boolean calculus;
	    boolean abnormalGrowth;
	    boolean cleftLip;
	    boolean other;
		*/
		//s = search.search();
		
		/*studentID = s.getStudentID();
		
		System.out.println("Add Initial Condition to " + s.getSurname()
				+ ", " + s.getFirstname() + " " + s.getMi());
		
		System.out.println("Enter date of exam:");
		dateOfExam = input.readLine();
		
		System.out.println("Dental Caries? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) dentalCaries = true;
		else dentalCaries = false;
		
		System.out.println("Gingivitis Periodontal Disease? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) gingivitis = true;
		else gingivitis = false;

		System.out.println("Debris? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) debris = true;
		else debris = false;

		System.out.println("Calculus? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) calculus = true;
		else calculus = false;
		
		System.out.println("Abnormal Growth? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) abnormalGrowth = true;
		else abnormalGrowth = false;
			
		System.out.println("Cleft Lip/Palate? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) cleftLip = true;
		else cleftLip = false;		
		
		System.out.println("Others (supernumerary/mesiodens, etc.)? (y/n):");
		if(input.readLine().equalsIgnoreCase("y")) other = true;
		else other = false;
		*/
		boolean result = aicc.validateInitialConditionEntries(studentID, dateOfExam, 
				dentalCaries,gingivitis, debris,calculus, abnormalGrowth,
    			cleftLip, other);
		
		if(result){
			aicv.displayAcknowledgement();
		}else System.out.println("Error.");
		
    }
}
